package demo4;

import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
import org.omg.CORBA.ARG_OUT;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Home-pc
 * Date: 2023-08-16
 * Time: 15:51
 */
interface IFlying{
    void fly();
}
interface IRunning{
    void run();
}
interface ISwimming{
    void swim();
}

class Animal{
    protected String name;

    public Animal(String name){
        this.name=name;
    }
}

class Bird extends Animal implements IFlying{
    public Bird(String name) {
        super(name);
    }
    @Override
    public void fly() {
        System.out.println("鸟在飞");
    }
}
class Frog extends Animal implements IRunning,ISwimming{

    public Frog(String name) {
        super(name);
    }

    @Override
    public void run() {
        System.out.println("青蛙正在跳");
    }

    @Override
    public void swim() {
        System.out.println("青蛙正在游");
    }
}
public class Test {
    public static void testFly(IFlying iFlying){
        iFlying.fly();
    }
    public static void testRun(IRunning iRunning){
        iRunning.run();
    }
    public static void testSwim(ISwimming iSwimming){
        iSwimming.swim();
    }

    public static void main(String[] args) {
        IFlying iFlying=new Bird("qwert");
        Animal animal=new Bird("qwert");
        testFly(iFlying);

    }
}


interface A{
    void testA();
}
interface B{
    void testB();
}
interface C extends A,B{
    void testC();
}

